//
// CPSLocated.java
// Copyright (C) 2010  "Naush" <naush _ hotmail _ fr>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>./* ----------------------------------------------------------------------------







package org.ryzom.nel.threed;

import org.ryzom.nel.misc.CVector;
import org.ryzom.nel.misc.IStream;

public class CPSLocated extends CParticleSystemProcess {
  private long swigCPtr;

  public CPSLocated(long cPtr, boolean cMemoryOwn) {
    super(nel3dJNI.CPSLocated_SWIGUpcast(cPtr), cMemoryOwn);
    swigCPtr = cPtr;
  }

  public static long getCPtr(CPSLocated obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nel3dJNI.delete_CPSLocated(swigCPtr);
      }
      swigCPtr = 0;
    }
    super.delete();
  }

  public CPSLocated() {
    this(nel3dJNI.new_CPSLocated(), true);
  }

  public boolean isLocated() {
    return nel3dJNI.CPSLocated_isLocated(swigCPtr, this);
  }

  public boolean bind(CPSLocatedBindable lb) {
    return nel3dJNI.CPSLocated_bind(swigCPtr, this, CPSLocatedBindable.getCPtr(lb), lb);
  }

  public CPSLocatedBindable unbind(long index) {
    long cPtr = nel3dJNI.CPSLocated_unbind(swigCPtr, this, index);
    return (cPtr == 0) ? null : new CPSLocatedBindable(cPtr, false);
  }

  public boolean isBound(CPSLocatedBindable lb) {
    return nel3dJNI.CPSLocated_isBound(swigCPtr, this, CPSLocatedBindable.getCPtr(lb), lb);
  }

  public long getIndexOf(CPSLocatedBindable lb) {
    return nel3dJNI.CPSLocated_getIndexOf(swigCPtr, this, CPSLocatedBindable.getCPtr(lb), lb);
  }

  public void remove(CPSLocatedBindable lb) {
    nel3dJNI.CPSLocated_remove(swigCPtr, this, CPSLocatedBindable.getCPtr(lb), lb);
  }

  public void releaseRefTo(CParticleSystemProcess other) {
    nel3dJNI.CPSLocated_releaseRefTo(swigCPtr, this, CParticleSystemProcess.getCPtr(other), other);
  }

  public void releaseAllRef() {
    nel3dJNI.CPSLocated_releaseAllRef(swigCPtr, this);
  }

  public long getNbBoundObjects() {
    return nel3dJNI.CPSLocated_getNbBoundObjects(swigCPtr, this);
  }

  public CPSLocatedBindable getBoundObject(long index) {
    long cPtr = nel3dJNI.CPSLocated_getBoundObject__SWIG_0(swigCPtr, this, index);
    return (cPtr == 0) ? null : new CPSLocatedBindable(cPtr, false);
  }

  public void postNewElement(CVector pos, CVector speed, CPSLocated emitterLocated, long indexInEmitter, TPSMatrixMode speedCoordSystem, float lifeTime) {
    nel3dJNI.CPSLocated_postNewElement(swigCPtr, this, CVector.getCPtr(pos), pos, CVector.getCPtr(speed), speed, CPSLocated.getCPtr(emitterLocated), emitterLocated, indexInEmitter, speedCoordSystem.swigValue(), lifeTime);
  }

  public int newElement(CVector pos, CVector speed, CPSLocated emitterLocated, long indexInEmitter, TPSMatrixMode speedCoordSystem, boolean doEmitOnce) {
    return nel3dJNI.CPSLocated_newElement__SWIG_0(swigCPtr, this, CVector.getCPtr(pos), pos, CVector.getCPtr(speed), speed, CPSLocated.getCPtr(emitterLocated), emitterLocated, indexInEmitter, speedCoordSystem.swigValue(), doEmitOnce);
  }

  public int newElement(CVector pos, CVector speed, CPSLocated emitterLocated, long indexInEmitter, TPSMatrixMode speedCoordSystem) {
    return nel3dJNI.CPSLocated_newElement__SWIG_1(swigCPtr, this, CVector.getCPtr(pos), pos, CVector.getCPtr(speed), speed, CPSLocated.getCPtr(emitterLocated), emitterLocated, indexInEmitter, speedCoordSystem.swigValue());
  }

  public void deleteElement(long index) {
    nel3dJNI.CPSLocated_deleteElement(swigCPtr, this, index);
  }

  public float getAgeInSeconds(long elementIndex) {
    return nel3dJNI.CPSLocated_getAgeInSeconds(swigCPtr, this, elementIndex);
  }

  public CScene getScene() {
    long cPtr = nel3dJNI.CPSLocated_getScene(swigCPtr, this);
    return (cPtr == 0) ? null : new CScene(cPtr, false);
  }

  public void getLODVect(CVector v, SWIGTYPE_p_float offset, TPSMatrixMode matrixMode) {
    nel3dJNI.CPSLocated_getLODVect(swigCPtr, this, CVector.getCPtr(v), v, SWIGTYPE_p_float.getCPtr(offset), matrixMode.swigValue());
  }

  public void incrementNbDrawnParticles(long num) {
    nel3dJNI.CPSLocated_incrementNbDrawnParticles(swigCPtr, this, num);
  }

  public long getNewElementIndex() {
    return nel3dJNI.CPSLocated_getNewElementIndex(swigCPtr, this);
  }

  public boolean computeBBox(SWIGTYPE_p_NLMISC__CAABBox aabbox) {
    return nel3dJNI.CPSLocated_computeBBox(swigCPtr, this, SWIGTYPE_p_NLMISC__CAABBox.getCPtr(aabbox));
  }

  public void setInitialLife(float lifeTime) {
    nel3dJNI.CPSLocated_setInitialLife(swigCPtr, this, lifeTime);
  }

  public void setLifeScheme(SWIGTYPE_p_NL3D__CPSAttribMakerT_float_t scheme) {
    nel3dJNI.CPSLocated_setLifeScheme(swigCPtr, this, SWIGTYPE_p_NL3D__CPSAttribMakerT_float_t.getCPtr(scheme));
  }

  public float getInitialLife() {
    return nel3dJNI.CPSLocated_getInitialLife(swigCPtr, this);
  }

  public SWIGTYPE_p_NL3D__CPSAttribMakerT_float_t getLifeScheme() {
    long cPtr = nel3dJNI.CPSLocated_getLifeScheme__SWIG_0(swigCPtr, this);
    return (cPtr == 0) ? null : new SWIGTYPE_p_NL3D__CPSAttribMakerT_float_t(cPtr, false);
  }

  public void setInitialMass(float mass) {
    nel3dJNI.CPSLocated_setInitialMass(swigCPtr, this, mass);
  }

  public void setMassScheme(SWIGTYPE_p_NL3D__CPSAttribMakerT_float_t scheme) {
    nel3dJNI.CPSLocated_setMassScheme(swigCPtr, this, SWIGTYPE_p_NL3D__CPSAttribMakerT_float_t.getCPtr(scheme));
  }

  public float getInitialMass() {
    return nel3dJNI.CPSLocated_getInitialMass(swigCPtr, this);
  }

  public SWIGTYPE_p_NL3D__CPSAttribMakerT_float_t getMassScheme() {
    long cPtr = nel3dJNI.CPSLocated_getMassScheme__SWIG_0(swigCPtr, this);
    return (cPtr == 0) ? null : new SWIGTYPE_p_NL3D__CPSAttribMakerT_float_t(cPtr, false);
  }

  public boolean setLastForever() {
    return nel3dJNI.CPSLocated_setLastForever(swigCPtr, this);
  }

  public boolean getLastForever() {
    return nel3dJNI.CPSLocated_getLastForever(swigCPtr, this);
  }

  public SWIGTYPE_p_NL3D__CPSAttribT_float_t getInvMass() {
    return new SWIGTYPE_p_NL3D__CPSAttribT_float_t(nel3dJNI.CPSLocated_getInvMass__SWIG_0(swigCPtr, this), false);
  }

  public SWIGTYPE_p_NL3D__CPSAttribT_NLMISC__CVector_t getPos() {
    return new SWIGTYPE_p_NL3D__CPSAttribT_NLMISC__CVector_t(nel3dJNI.CPSLocated_getPos__SWIG_0(swigCPtr, this), false);
  }

  public SWIGTYPE_p_NL3D__CPSAttribT_NLMISC__CVector_t getSpeed() {
    return new SWIGTYPE_p_NL3D__CPSAttribT_NLMISC__CVector_t(nel3dJNI.CPSLocated_getSpeed__SWIG_0(swigCPtr, this), false);
  }

  public SWIGTYPE_p_NL3D__CPSAttribT_float_t getTime() {
    return new SWIGTYPE_p_NL3D__CPSAttribT_float_t(nel3dJNI.CPSLocated_getTime__SWIG_0(swigCPtr, this), false);
  }

  public SWIGTYPE_p_NL3D__CPSAttribT_float_t getTimeIncrement() {
    return new SWIGTYPE_p_NL3D__CPSAttribT_float_t(nel3dJNI.CPSLocated_getTimeIncrement__SWIG_0(swigCPtr, this), false);
  }

  public void step(TPSProcessPass pass) {
    nel3dJNI.CPSLocated_step(swigCPtr, this, pass.swigValue());
  }

  public void computeMotion() {
    nel3dJNI.CPSLocated_computeMotion(swigCPtr, this);
  }

  public void computeNewParticleMotion(long firstInstanceIndex) {
    nel3dJNI.CPSLocated_computeNewParticleMotion(swigCPtr, this, firstInstanceIndex);
  }

  public void updateCollisions() {
    nel3dJNI.CPSLocated_updateCollisions(swigCPtr, this);
  }

  public long getSize() {
    return nel3dJNI.CPSLocated_getSize(swigCPtr, this);
  }

  public long getMaxSize() {
    return nel3dJNI.CPSLocated_getMaxSize(swigCPtr, this);
  }

  public void resize(long newSize) {
    nel3dJNI.CPSLocated_resize(swigCPtr, this, newSize);
  }

  public void serial(IStream f) {
    nel3dJNI.CPSLocated_serial(swigCPtr, this, IStream.getCPtr(f), f);
  }

  public IDriver getDriver() {
    long cPtr = nel3dJNI.CPSLocated_getDriver(swigCPtr, this);
    return (cPtr == 0) ? null : new IDriver(cPtr, false);
  }

  public float getUserParam(long numParam) {
    return nel3dJNI.CPSLocated_getUserParam(swigCPtr, this, numParam);
  }

  public void setupDriverModelMatrix() {
    nel3dJNI.CPSLocated_setupDriverModelMatrix(swigCPtr, this);
  }

  public CVector computeI() {
    return new CVector(nel3dJNI.CPSLocated_computeI(swigCPtr, this), true);
  }

  public CVector computeIWithZAxisAligned() {
    return new CVector(nel3dJNI.CPSLocated_computeIWithZAxisAligned(swigCPtr, this), true);
  }

  public CVector computeJ() {
    return new CVector(nel3dJNI.CPSLocated_computeJ(swigCPtr, this), true);
  }

  public CVector computeK() {
    return new CVector(nel3dJNI.CPSLocated_computeK(swigCPtr, this), true);
  }

  public CVector computeKWithZAxisAligned() {
    return new CVector(nel3dJNI.CPSLocated_computeKWithZAxisAligned(swigCPtr, this), true);
  }

  public void queryCollisionInfo() {
    nel3dJNI.CPSLocated_queryCollisionInfo(swigCPtr, this);
  }

  public void releaseCollisionInfo() {
    nel3dJNI.CPSLocated_releaseCollisionInfo(swigCPtr, this);
  }

  public boolean hasCollisionInfos() {
    return nel3dJNI.CPSLocated_hasCollisionInfos(swigCPtr, this);
  }

  public void computeSpawns(long firstInstanceIndex, boolean includeEmitOnce) {
    nel3dJNI.CPSLocated_computeSpawns(swigCPtr, this, firstInstanceIndex, includeEmitOnce);
  }

  public void computeForces() {
    nel3dJNI.CPSLocated_computeForces(swigCPtr, this);
  }

  public void computeCollisions(long firstInstanceIndex, CVector posBefore, CVector posAfter) {
    nel3dJNI.CPSLocated_computeCollisions(swigCPtr, this, firstInstanceIndex, CVector.getCPtr(posBefore), posBefore, CVector.getCPtr(posAfter), posAfter);
  }

  public static SWIGTYPE_p_NLMISC__CMatrix getConversionMatrix(CParticleSystem ps, TPSMatrixMode to, TPSMatrixMode from) {
    return new SWIGTYPE_p_NLMISC__CMatrix(nel3dJNI.CPSLocated_getConversionMatrix__SWIG_0(CParticleSystem.getCPtr(ps), ps, to.swigValue(), from.swigValue()), false);
  }

  public static SWIGTYPE_p_NLMISC__CMatrix getConversionMatrix(CPSLocated A, CPSLocated B) {
    return new SWIGTYPE_p_NLMISC__CMatrix(nel3dJNI.CPSLocated_getConversionMatrix__SWIG_1(CPSLocated.getCPtr(A), A, CPSLocated.getCPtr(B), B), false);
  }

  public SWIGTYPE_p_NLMISC__CMatrix getLocalToWorldMatrix() {
    return new SWIGTYPE_p_NLMISC__CMatrix(nel3dJNI.CPSLocated_getLocalToWorldMatrix(swigCPtr, this), false);
  }

  public SWIGTYPE_p_NLMISC__CMatrix getWorldToLocalMatrix() {
    return new SWIGTYPE_p_NLMISC__CMatrix(nel3dJNI.CPSLocated_getWorldToLocalMatrix(swigCPtr, this), false);
  }

  public void registerDtorObserver(CPSLocatedBindable observer) {
    nel3dJNI.CPSLocated_registerDtorObserver(swigCPtr, this, CPSLocatedBindable.getCPtr(observer), observer);
  }

  public void unregisterDtorObserver(CPSLocatedBindable anObserver) {
    nel3dJNI.CPSLocated_unregisterDtorObserver(swigCPtr, this, CPSLocatedBindable.getCPtr(anObserver), anObserver);
  }

  public void setName(String name) {
    nel3dJNI.CPSLocated_setName(swigCPtr, this, name);
  }

  public String getName() {
    return nel3dJNI.CPSLocated_getName(swigCPtr, this);
  }

  public boolean hasParticles() {
    return nel3dJNI.CPSLocated_hasParticles(swigCPtr, this);
  }

  public boolean hasEmitters() {
    return nel3dJNI.CPSLocated_hasEmitters(swigCPtr, this);
  }

  public void forceLODDegradation(boolean enable) {
    nel3dJNI.CPSLocated_forceLODDegradation__SWIG_0(swigCPtr, this, enable);
  }

  public void forceLODDegradation() {
    nel3dJNI.CPSLocated_forceLODDegradation__SWIG_1(swigCPtr, this);
  }

  public boolean hasLODDegradation() {
    return nel3dJNI.CPSLocated_hasLODDegradation(swigCPtr, this);
  }

  public long getNumWantedTris() {
    return nel3dJNI.CPSLocated_getNumWantedTris(swigCPtr, this);
  }

  public void setMatrixMode(TPSMatrixMode matrixMode) {
    nel3dJNI.CPSLocated_setMatrixMode(swigCPtr, this, matrixMode.swigValue());
  }

  public boolean supportParametricMotion() {
    return nel3dJNI.CPSLocated_supportParametricMotion(swigCPtr, this);
  }

  public void enableParametricMotion(boolean enable) {
    nel3dJNI.CPSLocated_enableParametricMotion__SWIG_0(swigCPtr, this, enable);
  }

  public void enableParametricMotion() {
    nel3dJNI.CPSLocated_enableParametricMotion__SWIG_1(swigCPtr, this);
  }

  public boolean isParametricMotionEnabled() {
    return nel3dJNI.CPSLocated_isParametricMotionEnabled(swigCPtr, this);
  }

  public void performParametricMotion(float date) {
    nel3dJNI.CPSLocated_performParametricMotion(swigCPtr, this, date);
  }

  public void updateLife() {
    nel3dJNI.CPSLocated_updateLife(swigCPtr, this);
  }

  public void removeOldParticles() {
    nel3dJNI.CPSLocated_removeOldParticles(swigCPtr, this);
  }

  public void addNewlySpawnedParticles() {
    nel3dJNI.CPSLocated_addNewlySpawnedParticles(swigCPtr, this);
  }

  public void integrateSingle(float startDate, float deltaT, long numStep, long indexInLocated, CVector destPos, long posStride) {
    nel3dJNI.CPSLocated_integrateSingle__SWIG_0(swigCPtr, this, startDate, deltaT, numStep, indexInLocated, CVector.getCPtr(destPos), destPos, posStride);
  }

  public void integrateSingle(float startDate, float deltaT, long numStep, long indexInLocated, CVector destPos) {
    nel3dJNI.CPSLocated_integrateSingle__SWIG_1(swigCPtr, this, startDate, deltaT, numStep, indexInLocated, CVector.getCPtr(destPos), destPos);
  }

  public void computeParametricPos(float date, long indexInLocated, CVector dest) {
    nel3dJNI.CPSLocated_computeParametricPos(swigCPtr, this, date, indexInLocated, CVector.getCPtr(dest), dest);
  }

  public void enableTriggerOnDeath(boolean enable) {
    nel3dJNI.CPSLocated_enableTriggerOnDeath__SWIG_0(swigCPtr, this, enable);
  }

  public void enableTriggerOnDeath() {
    nel3dJNI.CPSLocated_enableTriggerOnDeath__SWIG_1(swigCPtr, this);
  }

  public boolean isTriggerOnDeathEnabled() {
    return nel3dJNI.CPSLocated_isTriggerOnDeathEnabled(swigCPtr, this);
  }

  public void setTriggerEmitterID(long id) {
    nel3dJNI.CPSLocated_setTriggerEmitterID(swigCPtr, this, id);
  }

  public long getTriggerEmitterID() {
    return nel3dJNI.CPSLocated_getTriggerEmitterID(swigCPtr, this);
  }

  public float evalMaxDuration() {
    return nel3dJNI.CPSLocated_evalMaxDuration(swigCPtr, this);
  }

  public long getUserMatrixUsageCount() {
    return nel3dJNI.CPSLocated_getUserMatrixUsageCount(swigCPtr, this);
  }

  public void enumTexs(SWIGTYPE_p_std__vectorT_NLMISC__CSmartPtrT_NL3D__ITexture_t_t dest, IDriver drv) {
    nel3dJNI.CPSLocated_enumTexs(swigCPtr, this, SWIGTYPE_p_std__vectorT_NLMISC__CSmartPtrT_NL3D__ITexture_t_t.getCPtr(dest), IDriver.getCPtr(drv), drv);
  }

  public void setZBias(float value) {
    nel3dJNI.CPSLocated_setZBias(swigCPtr, this, value);
  }

  public void checkLife() {
    nel3dJNI.CPSLocated_checkLife(swigCPtr, this);
  }

  public void onShow(boolean shown) {
    nel3dJNI.CPSLocated_onShow(swigCPtr, this, shown);
  }

  public void set_PInfo(SWIGTYPE_p_NL3D__CPSAttribT_NL3D__CParametricInfo_t value) {
    nel3dJNI.CPSLocated__PInfo_set(swigCPtr, this, SWIGTYPE_p_NL3D__CPSAttribT_NL3D__CParametricInfo_t.getCPtr(value));
  }

  public SWIGTYPE_p_NL3D__CPSAttribT_NL3D__CParametricInfo_t get_PInfo() {
    long cPtr = nel3dJNI.CPSLocated__PInfo_get(swigCPtr, this);
    return (cPtr == 0) ? null : new SWIGTYPE_p_NL3D__CPSAttribT_NL3D__CParametricInfo_t(cPtr, false);
  }

  public void registerIntegrableForce(CPSForce f) {
    nel3dJNI.CPSLocated_registerIntegrableForce(swigCPtr, this, CPSForce.getCPtr(f), f);
  }

  public void unregisterIntegrableForce(CPSForce f) {
    nel3dJNI.CPSLocated_unregisterIntegrableForce(swigCPtr, this, CPSForce.getCPtr(f), f);
  }

  public void integrableForceBasisChanged(TPSMatrixMode basis) {
    nel3dJNI.CPSLocated_integrableForceBasisChanged(swigCPtr, this, basis.swigValue());
  }

  public void addNonIntegrableForceRef() {
    nel3dJNI.CPSLocated_addNonIntegrableForceRef(swigCPtr, this);
  }

  public void releaseNonIntegrableForceRef() {
    nel3dJNI.CPSLocated_releaseNonIntegrableForceRef(swigCPtr, this);
  }

  public SWIGTYPE_p_NL3D__CPSAttribT_NL3D__CParametricInfo_t getParametricInfos() {
    return new SWIGTYPE_p_NL3D__CPSAttribT_NL3D__CParametricInfo_t(nel3dJNI.CPSLocated_getParametricInfos(swigCPtr, this), false);
  }

  public void systemDateChanged() {
    nel3dJNI.CPSLocated_systemDateChanged(swigCPtr, this);
  }

  public void resetCollisions(long numInstances) {
    nel3dJNI.CPSLocated_resetCollisions(swigCPtr, this, numInstances);
  }

  public void doLODDegradation() {
    nel3dJNI.CPSLocated_doLODDegradation(swigCPtr, this);
  }

  public static void set_FirstCollision(CPSCollisionInfo value) {
    nel3dJNI.CPSLocated__FirstCollision_set(CPSCollisionInfo.getCPtr(value), value);
  }

  public static CPSCollisionInfo get_FirstCollision() {
    long cPtr = nel3dJNI.CPSLocated__FirstCollision_get();
    return (cPtr == 0) ? null : new CPSCollisionInfo(cPtr, false);
  }

  public static void set_Collisions(SWIGTYPE_p_std__vectorT_NL3D__CPSCollisionInfo_t value) {
    nel3dJNI.CPSLocated__Collisions_set(SWIGTYPE_p_std__vectorT_NL3D__CPSCollisionInfo_t.getCPtr(value));
  }

  public static SWIGTYPE_p_std__vectorT_NL3D__CPSCollisionInfo_t get_Collisions() {
    long cPtr = nel3dJNI.CPSLocated__Collisions_get();
    return (cPtr == 0) ? null : new SWIGTYPE_p_std__vectorT_NL3D__CPSCollisionInfo_t(cPtr, false);
  }

}
